package com.sjyl.kaoshitong.activities;

import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v7.widget.Toolbar;
import android.view.View;

import com.sjyl.kaoshitong.BaseActionBarActivity;
import com.sjyl.kaoshitong.R;
import com.sjyl.kaoshitong.fragment.LoginFragment;

/**
 * Created by ChangerLow on 15/7/16.
 * Email: changerlow@qq.com
 */
public class LoginActivity extends BaseActionBarActivity {
    private static final String TAG = "LoginActivity";
    private Toolbar toolbar;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.fragment_container);
        toolbar = getActionBarToolbar();
        getSupportActionBar().setDisplayHomeAsUpEnabled(false);
        getSupportActionBar().setTitle(getString(R.string.login));
        toolbar.setNavigationOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                finish();
                overridePendingTransition(R.anim.push_right_in, R.anim.push_right_out);
            }
        });
//     toolbar.setVisibility(View.GONE);

        Fragment fragment = LoginFragment.newInstance();
        FragmentManager fm = getSupportFragmentManager();
        fm.beginTransaction().add(R.id.container, fragment).commitAllowingStateLoss();
    }
}
